package com.open.capacity.forum.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class ArticleCategory implements Serializable {
    /**
     * id，主键自增
     */
    @TableId(value = "cateid", type = IdType.AUTO)
    private Integer cateid;

    /**
     * 分类专栏名称
     */
    private String caname;

    /**
     * 分类专栏简介
     */
    private String cainfo;

    /**
     * 所属用户
     */
    @JsonSerialize(using= ToStringSerializer.class)
    private Long userid;

    /**
     * 分类专栏配图
     */
    private String banner;

    /**
     * 排序
     */
    private Integer casort;

    /**
     * 数据状态1:正常 2:逻辑删除默认为1
     */
    @TableLogic(value = "1", delval = "2")
    private Boolean status;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date cretim;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updtim;

    private static final long serialVersionUID = 1L;
}

